1. Field of the Invention
The present invention relates to a microcomputer, and more specifically to a microcomputer having the function of monitoring the internal resource of the microcomputer from an external of the microcomputer.
2. Description of Related Art
In conventional microcomputers, when a register-register operation instruction is executed, an address of a target register within a register group is generated by a register address generation circuit on the basis of register designation information stored in an instruction register, and then, supplied to a register address bus, so that the content of the target register is read out. A predetermined operation is performed on the read-out content by an ALU (arithmetic logic unit). Thereafter, the content processed by the ALU is written back to a designated register within the register group through an internal data bus.
On the other hand, in the case of an instruction for transferring data from a memory to an internal register, a memory address is generated on the basis of memory address information stored in the instruction register, and the generated memory address is supplied through the internal data bus and stored in an address buffer. This address is outputted through an external address bus to an external memory. Data read out from the external memory is supplied through an external data bus to the microcomputer, and stored in a data buffer of the microcomputer.
Thereafter, in order to write the data into the internal register, an address of a target register within the register group is generated by the register address generation circuit on the basis of register designation information stored in the instruction register, and supplied to the register address bus. At the same time, the content of the data buffer is written through the internal data bus to a register designated by the generated address.
In the two typical operations of the microcomputer as mentioned above, attention should be attracted to whether or not the data to be processed in the course of execution of the instruction is outputted to the external of the microcomputer. In the case of transferring data between the memory and the internal register of the microcomputer, the address of the memory is outputted onto the external address bus, and the content of the memory is outputted onto the external data bus. Therefore, by monitoring the external address bus and the external data bus (and also, a read or write strobe signal in ordinary cases) in the external of the microcomputer, it is possible to detect the address and the data without distributing the operation of the microcomputer, and therefore, it is possible to sense the execution condition of the microcomputer from the external of the microcomputer.
However, in the case of the register-register operation, information appears only in the internal data bus and the register address bus of the microcomputer, and therefore, it is impossible to know what processing is performed in the microcomputer, from the external of the microcomputer.
In addition, in the case of handling the content of a RAM (random access memory) of the microcomputer, a processing performed in the microcomputer is outputted to the external of the microcomputer, similarly to the register-register operation as mentioned above. Therefore, in the case of handling an internal resource completely confined within the inside of the microcomputer, information is never outputted to the external of the microcomputer.
On the other hand, in developing a program for the microcomputer, it is often necessary to refer to the information of the confined internal resource. In order to satisfy this request, it is a conventional practice to temporarily stop the execution of the microcomputer, and to cause the microcomputer to execute an instruction for outputting information of an internal resource to an external, so that the information of the internal resource can be obtained in the external of the microcomputer.
However, in such an application in which a machine is controlled by use of the microcomputer, if the execution of the microcomputer is temporarily stopped, there is possibility that the machine runs uncontrollably or is broken down. In addition, if the execution of the microcomputer is temporarily stopped, the execution time of the program at the time of developing the program becomes different from the execution time of the program when the program is actually executed in the application, and therefore, it becomes impossible to develop the program under the actual time condition. For this application, the program development is very difficult, since there is no means for obtain the information of the internal resource completely confined within the inside of the microcomputer.